#define _CRT_SECURE_NO_WARNINGS 1

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;

int no;
int main()
{
	char a[1001] = { 0 }, b[1001] = { 0 }, c[1001] = { 0 };
	int n1[1001] = { 0 }, n2[1001] = { 0 }, tmp[1001] = { 0 },
		la = 0, lb = 0;
	no = scanf("%s", a);
	char noo = getchar();
	no = scanf("%s", b);
	la = strlen(a);
	lb = strlen(b);
	if ((la < lb) || ((la == lb) && (strcmp(a, b) < 0)))
	{
		strcpy(c, a);
		memset(a, '\0', 1000);
		strcpy(a, b);
		memset(b, '\0', 1000);
		strcpy(b, c);
		int t = la;
		la = lb;
		lb = t;
		cout << "-";
		memset(c, '\0', 1000);
	}
	for (int i = la - 1; i >= 0; i--)
	{
		n1[la - 1 - i] = a[i] - '0';
	}
	for (int i = lb - 1; i >= 0; i--)
	{
		n2[lb - 1 - i] = b[i] - '0';
	}
	for (int i = 0; i < la; i++)
	{
		if (n1[i] < n2[i])
		{
			n1[i] += 10;
			n1[i + 1]--;
		}
		tmp[i] = n1[i] - n2[i];
		c[la - 1 - i] = tmp[i] + '0';
	}
	cout << c;
	return 0;
}
